<template>
  <h2>欢迎来到About页面</h2>
</template>

<script>

export default {
    name:'About',
    //组件路由守卫，通过路由规则进入时调用
    beforeRouteEnter:(to,from,next)=>{
      if(localStorage.getItem('name') == '苏凉'){
        next();
      }else{
        alert('无权查看！')
      }
    },
    //通过路由规则离开时调用
    beforeRouteLeave:(to,from,next)=>{
      alert('11')
      next();
    }
}
</script>

<style>

</style>